package com.junsi.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import com.junsi.bean.Record;
import com.junsi.mapper.RecordMapper;
import com.junsi.service.RecordService;


@Service
@Transactional(rollbackFor = Exception.class)
public class RecordServiceImpl implements RecordService{
	@Autowired
	private RecordMapper recompile;
	@Override
	public List<Record> listAll() {
		List<Record> lsit=recompile.listAll();
		return lsit;
	}

	@Override
	public Record findById(Integer id) {
		Record record=recompile.findById(id);
		return record;
	}

	@Override
	public boolean insert(Record o) throws Exception {

		int result = recompile.insert(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

	@Override
	public boolean update(Record o) throws Exception {

		int result = recompile.update(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

	@Override
	public boolean delete(Integer id) {

		int result = recompile.delete(id);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

}
